using Iesi.Collections.Generic;

namespace Kotonoha.Server.Objects.Model {
    public class Tag {
        public virtual long Id { get; set; }
        public virtual string Name { get; set; }
        public virtual ISet<Word> Words { get; set; }


        public override string ToString() {
            return Name;
        }

        public virtual bool Equals(Tag obj) {
            if (ReferenceEquals(null, obj)) {
                return false;
            }
            if (ReferenceEquals(this, obj)) {
                return true;
            }
            return obj.Id == Id;
        }

        public override bool Equals(object obj) {
            if (ReferenceEquals(null, obj)) {
                return false;
            }
            if (ReferenceEquals(this, obj)) {
                return true;
            }
            if (obj.GetType() != typeof (Tag)) {
                return false;
            }
            return Equals((Tag) obj);
        }

        public override int GetHashCode() {
            return Id.GetHashCode();
        }
    }
}